package com.lguplus.servicepoi.gisp;

import com.lguplus.servicepoi.util.Util;

public class ImageMapRequest extends MessageHeader{

	private String cpCode;
	private String serviceCode;
	private String requestorID;
	private String phoneModel;
	private String browserName;
	private String browserVersion;
	private String repeatCount;
	private String coordType;
	private String colorType;
	private String screenSize;
	private int sclae;
	private int mapProfileID;
	private int x;
	private int y;
	private int radius;
	
	public ImageMapRequest() {
		this.cpCode = "";
		this.serviceCode = "";
		this.requestorID = "";
		this.phoneModel = "";
		this.browserName = "";
		this.browserVersion = "";
		this.repeatCount = "";
		this.coordType = "";
		this.colorType = "";
		this.screenSize = "";
		this.sclae = 0;
		this.mapProfileID = 0;
		this.x = 0;
		this.y = 0;
		this.radius = 0;
	}
	
	public byte[] getBytes() throws Exception{
		byte[] barr = new byte[116];
		byte[] harr = this.getHeaderBytes();
		byte[] result = new byte[barr.length + harr.length + 1];

		System.arraycopy(this.cpCode.getBytes(), 0, barr, 0, this.cpCode.getBytes().length > 12?12:this.cpCode.getBytes().length);
		System.arraycopy(this.serviceCode.getBytes(), 0, barr, 12, this.serviceCode.getBytes().length > 12?12:this.serviceCode.getBytes().length);
		System.arraycopy(this.requestorID.getBytes(), 0, barr, 24, this.requestorID.getBytes().length > 12?12:this.requestorID.getBytes().length);
		System.arraycopy(this.phoneModel.getBytes(), 0, barr, 36, this.phoneModel.getBytes().length > 12?12:this.phoneModel.getBytes().length);
		System.arraycopy(this.browserName.getBytes(), 0, barr, 48, this.browserName.getBytes().length > 12?12:this.browserName.getBytes().length);
		System.arraycopy(this.browserVersion.getBytes(), 0, barr, 60, this.browserVersion.getBytes().length > 12?12:this.browserVersion.getBytes().length);
		System.arraycopy(this.repeatCount.getBytes(), 0, barr, 72, this.repeatCount.getBytes().length > 4?4:this.repeatCount.getBytes().length);
		System.arraycopy(this.coordType.getBytes(), 0, barr, 76, this.coordType.getBytes().length > 4?4:this.coordType.getBytes().length);
		System.arraycopy(this.colorType.getBytes(), 0, barr, 80, this.colorType.getBytes().length > 6?6:this.colorType.getBytes().length);
		System.arraycopy(this.screenSize.getBytes(), 0, barr, 86, this.screenSize.getBytes().length > 10?10:this.screenSize.getBytes().length);
		System.arraycopy(Util.Int2byte(this.sclae), 0, barr, 96, 4);
		System.arraycopy(Util.Int2byte(this.mapProfileID), 0, barr, 100, 4);
		System.arraycopy(Util.Int2byte(this.x), 0, barr, 104, 4);
		System.arraycopy(Util.Int2byte(this.y), 0, barr, 108, 4);
		System.arraycopy(Util.Int2byte(this.radius), 0, barr, 112, 4);
		
		System.arraycopy(harr, 0, result, 0, harr.length);
		System.arraycopy(barr, 0, result, harr.length, barr.length);
		
		result[result.length - 1] = 0x04;

		return result;
	}
	
	public String getMessage(){
		return "";
	}

	public String getCpCode() {
		return cpCode;
	}

	public void setCpCode(String cpCode) {
		this.cpCode = cpCode;
	}

	public String getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}

	public String getRequestorID() {
		return requestorID;
	}

	public void setRequestorID(String requestorID) {
		this.requestorID = requestorID;
	}

	public String getPhoneModel() {
		return phoneModel;
	}

	public void setPhoneModel(String phoneModel) {
		this.phoneModel = phoneModel;
	}

	public String getBrowserName() {
		return browserName;
	}

	public void setBrowserName(String browserName) {
		this.browserName = browserName;
	}

	public String getBrowserVersion() {
		return browserVersion;
	}

	public void setBrowserVersion(String browserVersion) {
		this.browserVersion = browserVersion;
	}

	public String getRepeatCount() {
		return repeatCount;
	}

	public void setRepeatCount(String repeatCount) {
		this.repeatCount = repeatCount;
	}

	public String getCoordType() {
		return coordType;
	}

	public void setCoordType(String coordType) {
		this.coordType = coordType;
	}

	public String getColorType() {
		return colorType;
	}

	public void setColorType(String colorType) {
		this.colorType = colorType;
	}

	public String getScreenSize() {
		return screenSize;
	}

	public void setScreenSize(String screenSize) {
		this.screenSize = screenSize;
	}

	public int getSclae() {
		return sclae;
	}

	public void setSclae(int sclae) {
		this.sclae = sclae;
	}

	public int getMapProfileID() {
		return mapProfileID;
	}

	public void setMapProfileID(int mapProfileID) {
		this.mapProfileID = mapProfileID;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}
	
}
